/*	编写函数生成一张彩票,在主函数中把彩票里的数字打印在屏幕上(可以出现重复数字.)
 *
 */

#include"day08.h"

int main () {
	int ticket[7] = {};
	makeTicket(ticket, 7);
	for (int i = 0; i < 7; i++) {
		printf("%d ", ticket[i]);
	}
	printf("\n");
	return 0;
}


void makeTicket(int ticket[], int size) {
	srand(time(0));
	for (int i = 0; i < size; i++) {
		ticket[i] = rand() % 36 + 1;
		for (int j = 0; j < i; j++) {
			if (ticket[i] == ticket[j]) {
				i--;
				break;
			}
		}
	}
}

